<?php
if (isset($query) && count($query) > 0) {
    ?>
    <h1>Data Barang</h1>
    <table width="400" border="1" class="table table-striped">
        <thead>
            <tr>
                <th>#</th>
                <th>Job Order</th>
                <th>Congnee</th>
                <th>Origin</th>
                <th colspan="2">Print</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
        </thead>
        <?php
        $i = 0;
        foreach ($query as $row) {
            $i++;
            echo "<tr class=\"record\">";
            echo "<td>$i</td>";
            echo "<td>$row->job_order</td>";
            echo "<td>$row->consgnee</td>";
            echo "<td>$row->origin</td>";
            if ($row->agree == 'Y'){
                echo "<td><a href='" . base_url() . "pegawai1/cetak/$row->id_order' class='input btn btn-info btnPrint'>Print</a></td>";
            }
            else{
                echo "<td></td>";
            }
            if ($row->agree == 'Y'){
                echo "<td><a href='" . base_url() . "pegawai1/cetakjalan/$row->id_order' class='input btn btn-info btnPrint'>Print SJ</a></td>";
            }
            else{
                echo "<td></td>";
            }
            echo "<td><a href='" . base_url() . "pegawai1/edit/$row->id_order' class='fancybox fancybox.iframe input btn btn-success'>Edit</a></td>";
            echo "<td><a href='" . base_url() . "pegawai1/delconf/$row->id_order' class='fancybox fancybox.iframe input btn btn-warning'>Delete</a></td>";
            echo "</tr>";
        }
        ?>
    </table>
    <?php
}
?>